//
//  YFCashView.m
//  project
//
//  Created by yefei on 2019/4/15.
//  Copyright © 2019 健健. All rights reserved.
//

#import "YFCashView.h"

@interface YFCashView ()

@property (weak, nonatomic) IBOutlet UIView *infoView;
@property (weak, nonatomic) IBOutlet UIView *detailView;
@property (weak, nonatomic) IBOutlet UIView *bankView;

@property (weak, nonatomic) IBOutlet UILabel *numberLabel;
@property (weak, nonatomic) IBOutlet UILabel *priceLabel;
@property (weak, nonatomic) IBOutlet UILabel *serviceChargeLabel;
@property (weak, nonatomic) IBOutlet UILabel *summationLabel;


@property (weak, nonatomic) IBOutlet UIButton *bankNameButton;
@property (weak, nonatomic) IBOutlet UILabel *bankNumberLabel;
@property (weak, nonatomic) IBOutlet UIButton *addBankButton;

@property (weak, nonatomic) IBOutlet UIButton *exchangeCashButton;

@end

@implementation YFCashView

- (void)awakeFromNib {
    [super awakeFromNib];
    [self setupViews];
}

- (void)setupViews {
    [self.infoView rounded:(UIRectCornerAllCorners) radius:10];
    [self.detailView rounded:(UIRectCornerAllCorners) radius:10];
    [self.bankView rounded:(UIRectCornerAllCorners) radius:10];
    [self.addBankButton setBackgroundImage:[UIColor withRGB:242].image forState:(UIControlStateHighlighted)];
    
}

- (IBAction)exchangeButtonClicked:(UIButton *)sender {
    if (self.exchangeAction) {
        self.exchangeAction();
    }
}


- (IBAction)addBangButtonClicked:(UIButton *)sender {
    if (self.selectedBankAction) {
        self.selectedBankAction();
    }
}

#pragma mark - Setter 方法
- (void)setPrice:(NSString *)price {
    _price = price;
    self.priceLabel.text = [NSString stringWithFormat:@"¥%@", price];
}
- (void)setTotalPrice:(NSString *)totalPrice {
    _totalPrice = totalPrice;
   self.summationLabel.text = [NSString stringWithFormat:@"%@", totalPrice];
}

- (void)setTotalAmount:(NSString *)totalAmount {
    _totalAmount = totalAmount;
    self.numberLabel.text = [NSString stringWithFormat:@"共兑换%@件", totalAmount];
}

- (void)setServiceCharge:(NSString *)serviceCharge {
    _serviceCharge = serviceCharge;
    self.serviceChargeLabel.text = [NSString stringWithFormat:@"¥%@", serviceCharge];
}
@end
